﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace 装饰模式
{
    /// <summary>
    /// 人
    /// </summary>
    class Person
    {
        public string name { get; set; }
        public Person() { }
        public Person(string _name) 
        {
            Console.WriteLine(_name);
            this.name = _name;
        }
        public virtual void show()
        {
            Console.WriteLine("我是主播 fe fe ,平时直播打打游戏，颜值靠美图滤镜，一天滤镜失灵，榜一大哥把我抛弃，wooo,you are 维利 当次");
        }
    }

    /// <summary>
    /// 服饰类
    /// </summary>
    class Finery : Person
    {
        protected Person component;

        public void Decorate(Person component)
        {
            this.component = component;
        }

        public override void show()
        {
            if (component != null)
            {
                component.show();
            }
        }
    }

    /// <summary>
    /// 具体服饰类 ---T恤
    /// </summary>
    class Tshirts : Finery
    {
        public override void show()
        {
            Console.WriteLine("T恤");
            base.show();
        }
    }
    /// <summary>
    /// 具体服饰类 ---大棉袄
    /// </summary>
    class BigLammy : Finery
    {
        public override void show()
        {
            Console.WriteLine("大棉袄");
            base.show();
        }
    }

    /// <summary>
    /// 具体服饰类 ---保暖裤
    /// </summary>
    class WarmPants : Finery
    {
        public override void show()
        {
            Console.WriteLine("保暖裤");
            base.show();
        }
    }

}
